package main

import (
	"fmt"
	"log"
	myproto "testproto/proto"

	"github.com/golang/protobuf/proto"
)

func main() {
	fmt.Println("run")
	p := &myproto.TalkMsg{
		Id:  1,
		Msg: "test msg",
	}
	out, err := proto.Marshal(p)
	if err != nil {
		log.Fatalln("Failed to encode address book:", err)
	}
	fmt.Printf("out = %v\n", out)

	book := &myproto.TalkMsg{}
	proto.Unmarshal(out, book)
	fmt.Printf("book = %v\n", book)
}
